﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RoboRace_Shared
{
    public interface ICard
    {
        void Behavior(ref Robot robot);
    }

    [Serializable]
    public class ProgramCard : ICard
    {
        private int m_intPriority;
        private ACTION m_Action;
        private int m_value;
        private DIRECTION m_direction;
        private ROTATION m_rotation;

        public ProgramCard(int priority, ACTION action, int value, DIRECTION dir, ROTATION rot)
        {
            m_intPriority = priority;
            m_Action = action;
            m_value = value;
            m_direction = dir;
            m_rotation = rot;
        }

        public void Behavior(ref Robot curRobot)
        {
            switch (m_Action)
            {
                case ACTION.MOVE:
                    //curRobot.Move(m_value, m_direction);
                    break;

                case ACTION.ROTATE:
                    for (int x = 0; x < m_value; x++)
                    {
                        curRobot.Rotate(m_rotation);
                    }
                    break;
            }
        }

        public int Priority { get { return m_intPriority; } }
    }

    [Serializable]
    public class OptionCard : ICard
    {
        private string m_strDescription;

        public OptionCard(string desc)
        {
            if (desc != null)
            {
                m_strDescription = desc;
            }
            else
            {
                throw new ArgumentException("DESCRIPTION must not be null");
            }
        }

        public void Behavior(ref Robot curRobot)
        {

        }
    }
}

